package io.wongxd.demo.page.emo.ui

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import io.modifier.basic.emo.ui.core.Item

@Composable
fun CommonItem(text: String, onClick: (() -> Unit)? = null) {
    Box(
        modifier = Modifier
            .fillMaxWidth()
            .padding(horizontal = 16.dp, vertical = 8.dp)
            .clip(RoundedCornerShape(6.dp))
    ) {
        Item(
            title = text,
            background = MaterialTheme.colorScheme.surfaceVariant,
            titleTextStyle = MaterialTheme.typography.titleMedium,
            titleTextColor = MaterialTheme.colorScheme.onSurfaceVariant,
            onClick = onClick
        )
    }
}
